package com.yx.robot.sdk;

import android.content.Context;
import android.graphics.Bitmap;

import com.aaa.async.ProgressivePromise;
import com.aaa.async.Promise;
import com.iot.base.bean.account.Account;
import com.yx.robot.bean.message.IotMessage;
import com.yx.robot.bean.robot.Appointment;
import com.iot.product.sweeper.bean.CleanRecord;
import com.yx.robot.bean.robot.Device;
import com.iot.product.sweeper.bean.Robot;
import com.yx.robot.bean.robot.VoiceParam;
import com.yx.robot.sdk.req.AddFeedBackMsgParam;
import com.yx.robot.sdk.req.BaseStationParam;
import com.yx.robot.sdk.req.BindAccountParam;
import com.yx.robot.sdk.req.BluetoothScanDeviceBean;
import com.yx.robot.sdk.req.CameraInitParam;
import com.yx.robot.sdk.req.ChangePasswordParam;
import com.yx.robot.sdk.req.CheckAuthCodeParam;
import com.yx.robot.sdk.req.CleanParam;
import com.yx.robot.sdk.req.CleanSettingParam;
import com.yx.robot.sdk.req.ClearCustomModeParam;
import com.yx.robot.sdk.req.DeleteCleanRecordParam;
import com.yx.robot.sdk.req.DeleteNotificationParam;
import com.yx.robot.sdk.req.FeedBackDetailsParam;
import com.yx.robot.sdk.req.GetAuthCodeParam;
import com.yx.robot.sdk.req.GetCleanRecordDetailParam;
import com.yx.robot.sdk.req.GetCleanRecordParam;
import com.yx.robot.sdk.req.GetNotificationParam;
import com.yx.robot.sdk.req.GetPathParam;
import com.yx.robot.sdk.req.LoginParam;
import com.yx.robot.sdk.req.MergeRoomParam;
import com.yx.robot.sdk.req.NetworkConfigParam;
import com.yx.robot.sdk.req.RegisterParam;
import com.yx.robot.sdk.req.RemoteControlParam;
import com.yx.robot.sdk.req.RemoveDeviceParam;
import com.yx.robot.sdk.req.RemoveMapParam;
import com.yx.robot.sdk.req.RemoveSharedUserParam;
import com.yx.robot.sdk.req.RenameDeviceParam;
import com.yx.robot.sdk.req.RenameMapParam;
import com.yx.robot.sdk.req.RenameRoomParam;
import com.yx.robot.sdk.req.Request;
import com.yx.robot.sdk.req.ResetComsuptionParam;
import com.yx.robot.sdk.req.ResetMapParam;
import com.yx.robot.sdk.req.ResetPasswordParam;
import com.yx.robot.sdk.req.SaveCustomModeParam;
import com.yx.robot.sdk.req.SaveMapParam;
import com.yx.robot.sdk.req.SetAreaParam;
import com.yx.robot.sdk.req.SetMapParam;
import com.yx.robot.sdk.req.SetNickNameParam;
import com.yx.robot.sdk.req.SetQuiteTimeParam;
import com.yx.robot.sdk.req.ShareDeviceParam;
import com.yx.robot.sdk.req.SplitRoomParam;
import com.yx.robot.sdk.req.UploadHeadPicParam;

import java.util.List;

public interface IotService<E extends SdkException> {

    Device getCurrentDevice();

    void connectDevice(Device device);

    void disconnectDevice(Device device);

    //登录注册
    Promise<Account, E> login(LoginParam param);

    Promise<Account, E> bindMobile(BindAccountParam param);

    Promise<Void, E> sendBindVerifyCode(LoginParam param);

    Promise<Account, E> bindEmail(BindAccountParam param);

    Promise<Void, E> sendBindVerifyCodeWithEmail(LoginParam param);

    Promise<Void, E> getAuthCode(GetAuthCodeParam param);

    Promise<Void, E> checkAuthCode(CheckAuthCodeParam param);

    Promise<Account, E> register(RegisterParam param);

    Promise<Void, E> changPassword(ChangePasswordParam param);

    Promise<Void, E> resetPassword(ResetPasswordParam param);

    boolean isLogin();

    Promise<Void, E> setNickName(SetNickNameParam param);

    Promise<Void, E> setUserHead(UploadHeadPicParam param);

    Promise<Bitmap, E> getUserHeadPicture(String path);

    Promise<Account, E> getUserInfo();

    Promise<Void, E> logout();

    Promise<Void, E> cancelAccount();

    Promise<Account, E> updateUserInfo();

    //通知管理 获取通知 清除通知
    Promise<List<IotMessage>, E> getNotification(GetNotificationParam param);

    Promise<List<IotMessage>, E> getWarningNotification(GetNotificationParam param);

    Promise<Void, E> deleteNotification(DeleteNotificationParam param);

    Promise<Void, E> hasNewNotification(Request request);

    //设备列表管理
    Promise<List<Robot>, E> getDeviceList();

    Promise<Void, E> initNetworkConfig();

    ProgressivePromise<Device, E, String> addDevice(NetworkConfigParam param);

    Promise<Void, E> tuyaBluetoothScan();

    Promise<Void, E> tuyaStopLeScan();

    ProgressivePromise<Device, E, String> addTuyaBluetoothDevice(BluetoothScanDeviceBean param);

    Promise<Void, E> stopBluetoothConfig(BluetoothScanDeviceBean param);

    ProgressivePromise<Device, E, String> tuyaQrCodeConfig(NetworkConfigParam param);

    Promise<Void, E> getTuyaQrcodeConfigToken(NetworkConfigParam param);

    Promise<Void, E> shareDevice(ShareDeviceParam param);

    Promise<?, E> getSharedUser();

    Promise<Void, E> removeSharedUser(RemoveSharedUserParam param);

    Promise<Void, E> renameDevice(RenameDeviceParam param);

    Promise<?, E> getFirmwareInfo();

    Promise<Void, E> removeDevice(RemoveDeviceParam param);

    //预约
    Promise<Void, E> getAppointmentList();

    Promise<?, E> addAppointment(Appointment param);

    Promise<?, E> deleteAppointment(Appointment param);

    Promise<?, E> changeAppointment(Appointment param);

    //勿扰设置  开关/ 开始时间/结束时间/重复模式
    Promise<?, E> setQuiteTimeSettings(SetQuiteTimeParam param);

    Promise<?, E> getQuiteTimeSettings();

    //耗材管理
    Promise<?, E> getComsuptionInfo();

    Promise<?, E> resetComsuptionInfo(ResetComsuptionParam param);

    //清扫设置
    Promise<?, E> setCleanSettings(CleanSettingParam param);// 需要在下层拆分成很多单项设置的接口

    Promise<?, E> getCleanSettings();

    //清扫记录
    Promise<List<CleanRecord>, E> getCleanRecord(GetCleanRecordParam param);

    Promise<CleanRecord, E> getCleanRecordDetail(GetCleanRecordDetailParam param);

    Promise<?, E> deleteCleanRecord(DeleteCleanRecordParam param);

    Promise<?, E> getCleanStatistic();

    //清扫控制
    Promise<?, E> startSweep(CleanParam param);

    Promise<?, E> pauseSweep();

    Promise<?, E> continueSweep(CleanParam param);

    Promise<?, E> stopSweep();

    Promise<?, E> startRecharge();

    Promise<?, E> pauseRecharge();

    Promise<?, E> continueRecharge();

    Promise<?, E> stopRecharge();

    Promise<?, E> startRemoteControl();

    Promise<?, E> remoteControl(RemoteControlParam param);

    Promise<?, E> stopRemoteControl();

    Promise<?, E> locateDevice();

    Promise<?, E> collectDust();

    Promise<?, E> getDeviceState();

    //地图管理
    Promise<?, E> getMapList(); //多地图管理

    Promise<?, E> setCurrentMap(SetMapParam param);

    Promise<?, E> removeMap(RemoveMapParam param);

    Promise<?, E> resetMap(ResetMapParam param);

    Promise<?, E> saveMap(SaveMapParam param);

    Promise<?, E> renameMap(RenameMapParam param);

    Promise<?, E> requestMap();

    Promise<?, E> requestPath(GetPathParam param);

    Promise<?, E> requestArea();

    //禁区设置
    Promise<?, E> setArea(SetAreaParam param);

    //区域管理
    Promise<?, E> intelligentPartition();

    Promise<?, E> requestRoom();

    Promise<?, E> renameRoom(RenameRoomParam param);

    Promise<?, E> mergeRoom(MergeRoomParam param);

    Promise<?, E> resetRoom();

    Promise<?, E> splitRoom(SplitRoomParam param);

    Promise<?, E> clearCustomMode(ClearCustomModeParam param);

    Promise<?, E> saveCustomMode(SaveCustomModeParam param);

    Promise<?, E> getBaseStationVersion();//获取基站软件版本

    //更新
    Promise<?, E> checkNewVersion();

    ProgressivePromise<?, E, Integer> updateFirmware();

    Promise<?, E> getAutoUpgradeSwitchState();

    Promise<?, E> setChangeAutoUpgradeSwitchState(int state);

    Promise<?, E> addFeedbackMsg(AddFeedBackMsgParam param);

    Promise<?, E> getFeedbackList();

    Promise<?, E> getFeedbackMsg(FeedBackDetailsParam param);

    Promise<?, E> factoryReset();

    Promise<?, E> setVoice(VoiceParam param);

    Promise<?, E> getVoiceList();

    String getErrMsgByCode(Context context, String errCode);

    Promise<?, E> setBaseStation(BaseStationParam param);

    Promise<?, E> createMap();

    Promise<?, E> initVideo(CameraInitParam param);

    Promise<?, E> setVideoClarity(int mode);

    Promise<?, E> videoScreenshot();

    Promise<?, E> startVideoRecord();

    Promise<?, E> stopVideoRecord();

    Promise<?, E> startAudioRecord();

    Promise<?, E> stopAudioRecord();

    Promise<?, E> startPlayVideo();

    Promise<?, E> stopPlayVideo();

    Promise<?, E> destroyVideo();


}
